//////////////////////////////////////////////////////////////////////
// Material.h
//
// SHEN Fangyang
// me@shenfy.com
//
// Copyright (C) SHEN Fangyang, 2011, All rights reserved.
//////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////////////
//  Brief Description
//
//	Material data structure
//
//////////////////////////////////////////////////////////////////////
#pragma once
#include <BasisObj.h>
#include <string>
#include <boost/unordered_map.hpp>
#include <vector>

namespace grflib
{
	namespace engine
	{
		namespace core
		{
			struct CMaterial : public IResource
			{
			public:
				typedef boost::unordered_map<std::string, std::string> texture_slot_type;

				float ambient[3];
				float diffuse[3];
				float specular[3];
				float emit[3];
				float alpha;
				float specularity;
				boost::unordered_map<std::string /*texture usage*/, std::string /*texture name*/> textureSlots;
				std::vector<float> customData;

				CMaterial(void);
				~CMaterial(void);

				//set ambient, diffuse, specular, emit, specularity to ZERO, and alpha to ONE
				//clears all texture slots and customData
				void Reset(void);

				//dumb function
				virtual HRESULT OnCreateDevice(ID3D10Device *pd3dDevice, const DXGI_SURFACE_DESC *pBufferSurfaceDesc) { return S_OK;/*DO NOTHING*/}
			};
		} // namespace core
	} // namespace engine
} // namespace grflib